<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/jquery.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/jquery.easyui.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/locale/easyui-lang-zh_CN.js"/>"></script>
<link id="theme" rel="stylesheet" type="text/css"  href="<c:url value="js/jquery-easyui-1.5.4.2/themes/ui-cupertino/easyui.css"/>"/>
<link  rel="stylesheet" type="text/css" href="<c:url value="js/jquery-easyui-1.5.4.2/themes/icon.css"/>"/>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>增加准考证信息</title>
</head>

<body>
<style>
	.line{
		margin:5px 20px;
	}
	.div{
		float:left;
		margin:0px 50px 0px 10px; 
	}
	
</style>
<script type="text/javascript">
	$(function(){
		$(".admission_back").linkbutton({
			onClick:function(){
				$(".admission_back_").panel({
					href:"to_admission"
					
				})
			}
		})
	});
	
	$(function(){
		$('#stainId').textbox({
			icons: [{
				iconCls:'icon-add',
				handler: function(e){
					$("#admission_insert_win").dialog("open");
					$("#hhy_admission_insert_tiku").datagrid({onDblClickRow:function(index,row){
						var admission_Id = row.stainId;
						var admission_Name= row.stainName;
						$('#stainName').textbox('setValue',admission_Name);
						$("#stainId").textbox("setValue",admission_Id);
						$("#stainNam").textbox("setValue",admission_Name);
						$("#admission_insert_win").dialog("close");

					}});
				}
			}]
		})
		
		
		//添加
		$("#hhy_admission_insert_add").linkbutton({onClick:function(){
			if ($('#admId').textbox("getText")=='' || $('#stainNam').textbox("getText")=='') {   
				$.messager.confirm('提示','带*的为必填项',function(r){    
				}); 
			}else{
			$("#admission_insert_form").form({
				url:'admission_insert',
				onSubmit:function(insert){
					insert["admission.admId"] = $("#admId").textbox("getText");
					insert["admission.admRemark"] = $("#admRemark").val();
					insert["staffInformation.stainId"] = $("#stainId").textbox("getText");
					insert["staffInformation.stainName"] = $("#stainName").textbox("getText");
					insert["definitionDept.defideName"] = $("#defideName").val();
					
				},
				success:function(v){
					v = eval("("+v+")");
					if(v.success){
						$.messager.alert('恭喜', '添加成功');
						$(".admission_back_").panel({
							href:"to_admission"
							
						})
					}else{
						$.messager.alert('错误', '对不起，操作失败，原因：'+v.message);
					}
				}
			}).submit();
			}
		}});
		
			
		
		
	});		
	
	
</script>
<div class="easyui-panel admission_back_" data-options="fit:true,border:false">
	<a href="#" class="easyui-linkbutton admission_back"  data-options="iconCls:'icon-back',plain:true,text:'返回'"></a>
	<a href="#" class="easyui-linkbutton"  data-options="iconCls:'icon-filesave',plain:true,text:'保存'"></a>
	<form id="admission_insert_form" method="post"></form>
		<div class="div">
			<div style="border-bottom:2px solid blue;width:650px;">准考证信息</div>
				<div class="line">
					<input class="easyui-textbox" name="admId" id="admId" data-options="label:'*准考证号',width:350,height:25,labelWidth:130"/>
				</div>
				<div class="line">
					<input class="easyui-textbox" name="stainNam" id="stainName" data-options="label:'*姓名',width:350,height:25,labelWidth:130"/>
				</div>
				<div class="line">
					<input class="easyui-textbox" name="stainId" id="stainId" data-options="label:'员工',width:235,height:25,labelWidth:130"/>
					<input class="easyui-textbox" name="stainName" id="stainNam" data-options="width:110,height:25"/>
				</div>
				<div class="line">
					<select name="defideName" id="defideName" class="easyui-combobox" data-options="label:'部门',width:235,height:25,panelHeight:'auto',labelWidth:130,editable:false">
						<c:forEach items="${admDefide}" var="ad">
							<option >${ad.defideName}</option>
						</c:forEach>
					</select>
				</div>
				
			</div>
			<div class="div">
				<div style="border-bottom:2px solid blue;width:650px;margin-bottom:5px;">备注</div>
				<div class="">
					<textarea id="admRemark" name="admRemark" rows="5" cols="110"></textarea>
				</div>
				<div class="line">
					<a id="hhy_admission_insert_add" class="easyui-linkbutton" data-options="width:80,height:30,text:'添加'"></a>
				</div>
			</div>
			
			<div class="easyui-dialog" id="admission_insert_win" data-options="width:550,height:400,title:'清单查找-题库',
				modal:true,
				closed:true,
				buttons:[{
					text:'确定',
					iconCls:'icon-ok',
					handler:function(){
						$('#admission_close').form({
							onSubmit:function(){
								var row = $('#hhy_admission_insert_tiku').datagrid('getSelected');
									 	var admission_Id = row.stainId;
										var admission_Name=row.stainName;
										$('#stainName').textbox('setValue',admission_Nam);
										$('#stainId').textbox('setValue',admission_Id);
										$('#stainNam').textbox('setValue',admission_Name);
								
							},success:function(v){
								$('#admission_insert_win').dialog('close');
							}
						}).submit();
					}
				},{
					text:'取消',
					iconCls:'icon-clear',
					handler:function(){
						$('#admission_insert_win').dialog('close');
					}
				}]">
				<form action="" method="post" id="admission_close">
					<div class="line">
						<input class="easyui-textbox" name="stainId" data-options="label:'题库编号',width:300,field:'stainId'"/>
						<a class="easyui-linkbutton" name="vague" data-options="text:'模糊查询',width:100" style="float:right"/>
					</div>
					<div class="line">
						<input class="easyui-textbox" name="stainName" data-options="label:'题库名称',width:300,field:'stainName'"/>
						<a class="easyui-linkbutton" name="vague" data-options="text:'搜索',width:100" style="float:right"/>
					</div>
					<div class="line">
						<table id="hhy_admission_insert_tiku" style="width:100%;height:220px;" class="easyui-datagrid" data-options="
							url:'findAll_admission_page',
							method:'get',
							pagination:true,
							pageSize:1,
							pageList:[1,2,3,4,5],
							autoRowHeight:true,
							nowrap:false,
							rownumbers:true,
							singleSelect:true,
							striped:true
							
							">
							<thead>
							  <tr>
								<th data-options="align:'center',field:'stainId',width:100">用户编号</th>
								<th data-options="align:'center',field:'stainName',width:120">用户名称</th>
							  </tr>
							</thead>
							<tbody>
								
							</tbody>
						</table>
					</div>
				</form>
			</div>
	
</div>
</body>
</html>